<!doctype html>
<?php
	include("conn.php");
	?>
<?php	
	session_start();
	$username=$_SESSION["username"];
	$userpassword=$_SESSION["userpassword"]; 
	?>
<html>
<head>
  <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>个人信息</title>
    <link rel="stylesheet" href="css/common.css" />
    <link rel="stylesheet" href="css/header.css" />
    <link rel="stylesheet" href="css/goodsList.css" />
	<link rel="stylesheet" href="css/mycar.css" />
	<link rel="stylesheet" href="canico.css">
</head>
<body>
    <header>
        <div id="head-top" style="margin-top: 5px;">
            <nav class="clearfix">

		  <div class="location" style="">
       <span>地区 ： </span>
      <i class="cd-location">&nbsp;<input type="text" class="selectBoxPub_r flightto" style="border:none;width:50px;background-color:#e6e3e6; font-size: 12px;"></i>
</div>		  

				  
				  
				  
				  
                <ul class="right clearfix">
                  <li class="menu welcome">
                       <?php
						if(!empty($_SESSION['identity'])){
                       echo "<a href='index.php' class='link-login'>主页</a>";}
						
					else{
							echo "<a href='login.php' class='link-login'>你好，请登录</a>";
						}
						
						?>
                    
                    </li>
                    <li class="spacer">|</li>
                    <li class="menu red"><a href="myorder.html" style="color:#999">加入我们</a></li>
                    <li class="spacer">|</li>
                    <li class="menu red">
                    <?php
					if(!empty($_SESSION['identity'])){
                    echo "<a href='myorder.php'>我的订单&nbsp;∨</a>";}
					else{
						 "<a href='myorder.php'>我的订单&nbsp;∨</a>";
					}
                    ?>
                    </li>
                    <li class="spacer">|</li>
                    <li class="menu red">企业合作</li>
                    <li class="spacer">|</li>
                    <li class="menu qiye"><a href="service.html">人工客服&nbsp;∨</a></li>
                    <li class="spacer">|</li>

                </ul>
            </nav>
        </div>
        <div class="w clearfix">
            <div id="logo">
                <a href="index.html"><img src="img/logo.png" ></a>
            </div>
            <div id="search">
                <!-- 搜索列表  已隐藏 -->
                <ul class="menu" id="shelper"></ul>
                <div class="form">
                    <input type="text" id="key" value="水果" class="text blurcolor">
                    <i class="fa fa-camera"></i>
                    <button>搜索</button>
                </div>
            </div>
            <div id="settleup" class="dropdown">
                <div class="cw-icon">
                    <i class="fa fa-shopping-cart car"></i>
                    <i class="i-count" id="count">0</i>
                    <a href="gwc.php">我的购物车</a>
                </div>
                
            </div>
            
        </div>
    </header>
    <section>
        <div id="nav">
            <div class="w clearfix">
                <div id="categorys" style="height: auto; left: 0px; position: absolute;">
                    <div class="dt">
                        <a href="#">我的基本信息</a>
                    </div>
                    <div class="dd" style="display: none;"></div>										
                </div>
                <div id="navitems" class="clearfix">
                    <ul class="navitems-group1 clearfix">
                        <li><a href="#">家庭账号绑定</a></li>
                        <li><a href="#">我的消息</a></li>
                        <li><a href="#">遇到问题？</a></li>
                    </ul>
  
                </div>
            </div>
        </div>
		        
        
		<div class="inf" style="">
		
		<h2 >  我的信息   </h2> 
		<br><br>
<?php
    $sql = "select * from  users where username= '$username'";
	$result = mysqli_query($conn,$sql);	
	while ($rows = mysqli_fetch_row($result))
	{
		
	echo	    "<p style='text-align: left;padding-left: 550px;'> <i class='cd-user'  style='font-size:30px; padding-botttom:300px;'></i>我的ID：" .$rows[0]. "</p>";	
	echo	    "<p style='text-align: left;padding-left: 550px;'> <i class='cd-user-l'  style='font-size:30px; padding-botttom:300px;'></i>我的用户名：" .$rows[1]. "</p>";
	echo	    "<p style='text-align: left;padding-left: 550px;'><i class='cd-lock'  style='font-size:30px; padding-botttom:300px;'></i> 我的密码：" .$rows[2]. "</p>";
	echo	    "<p style='text-align: left;padding-left: 550px;'> <i class='cd-medal-l'  style='font-size:30px; padding-botttom:300px;'></i>我的等级：" .$rows[3]. "</p>";
	echo        "<p style='text-align: left;padding-left: 550px;'> <i class='cd-mobile'  style='font-size:30px; padding-botttom:300px;'></i>我的电话：" .$rows[4]. "</p>";
	echo	    "<p style='text-align: left;padding-left: 550px;'> <i class='cd-people'  style='font-size:30px; padding-botttom:300px;'></i>我的实名：" .$rows[5]. "</p>";
	echo	    "<p style='text-align: left;padding-left: 550px;'><i class='cd-user-framework'  style='font-size:30px; padding-botttom:300px;'></i> 我的身份证：" .$rows[6]. "</p>";		
	echo	    "<p style='text-align: left;padding-left: 550px;'> <i class='cd-money'  style='font-size:30px; padding-botttom:300px;'></i>我的资金：" .$rows[7]. "元</p>";
	echo	    "<p style='text-align: left;padding-left: 550px;'> <i class='cd-location'  style='font-size:30px; padding-botttom:300px;'></i>我的地址：" .$rows[8]. "</p>";
	echo "<a href='updateEmp.php?&id=".$rows[0].'&username='.$rows[1]. '&password='.$rows[2].'&tel='.$rows[4].
		'&name='.$rows[5].'&card='.$rows[6].'&add='.$rows[8]."', style='padding-left: 550px; '><input type='submit' value='修改' class='submit' /></a>";
		
	}
			/*echo "<a href='updateEmp.php?action=update&id=".$rows[0]."'><input type='submit' value='修改' class='submit' /></a>";*/
?>		
		

		
		
		
		</div>
		
    </section> 
   
 
</body>
</html>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=eFaNjhaFcBEWaqwqs3N5ziq4PKUClOiY"></script>
 <script>
			var isLocate = false; //判断是否定位

			var flightto = document.querySelector(".flightto");
			//获取地理位置定位
			function locateMe() {
				var geolocation = new BMap.Geolocation();
				geolocation.getCurrentPosition(function(r) {
					if(this.getStatus() == BMAP_STATUS_SUCCESS) {
						isLocate = true;
						var url = "http://api.map.baidu.com/geocoder/v2/" +
							"?callback=renderReverse&location=" + r.point.lat + "," + r.point.lng + "&output=json&pois=1&ak=eFaNjhaFcBEWaqwqs3N5ziq4PKUClOiY";
						var JSONP = document.createElement("script");
						JSONP.src = url;
						document.body.appendChild(JSONP);
					} else {
						alert('failed' + this.getStatus());
					}
				}, {
					enableHighAccuracy: true
				})
			}
			locateMe();

			function renderReverse(r) {
				flightto.value = r.result.addressComponent.city;
				console.log(r);
			}
		</script>
